package co.com.smart.eagle.server.servicehandler.resources;

import java.util.List;

import co.com.smart.eagle.client.ParametroHandler;
import co.com.smart.eagle.client.rpcservices.resources.ResourcesService;
import co.com.smart.eagle.infrastructure.dto.RecursosDTO;
import co.com.smart.eagle.server.servicehandler.InvocationUtil;
import co.com.smart.eagle.server.servicehandler.InvocationUtil.Ejecutar;
import co.com.smart.eagle.session.DelegateContextEJB;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class ResourcesServiceImpl extends RemoteServiceServlet implements ResourcesService {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public ParametroHandler<List<RecursosDTO>> getResources() {
		return InvocationUtil.invocarMetodo(new Ejecutar<List<RecursosDTO>>() {
			@Override
			public List<RecursosDTO> getResultado() throws Exception {				
				return DelegateContextEJB.getResourcesBeanLocal().getResources();
			}
			
		}, "Error invocando el servicio de recursos");
	}

}
